<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
 <ui:composition template="/templates/Plantilla.xhtml">	
  <ui:define name="content">
   <h:form id="form">
   	<h3> Buscar Sujetos</h3>
	<p:separator/>
	<p:panel>
		<table>
			<tr>
				<td>
					<h:outputText value="Tipo de Busqueda"/>
				</td>
				<td>
					<p:selectOneRadio id="options" value="#{buscarSujeto.tipoBusqueda}">  
				       <f:selectItem itemLabel="Numero de Cliente" itemValue="NumeroCliente" />  
				       <f:selectItem itemLabel="Apellido" itemValue="Apellido" />  
				       <f:selectItem itemLabel="Razon Social" itemValue="RazonSocial"/>  
					</p:selectOneRadio>			
				</td>
			</tr>
		</table>

		
		<p:column><p:inputText /> </p:column>
		<p:column><p:commandButton id="cmdBuscar" icon="ui-icon-search" action="#{buscarSujeto.buscarPorCriterio}"  /> </p:column>
	</p:panel>  
		  
    	<br></br>
    	<p:dataTable id="cars" var="car" value="#{tableBean.carsSmall}"
    		emptyMessage="No se encontro ningun Sujeto">
    		  
  			<f:facet name ="header">
  				Sujetos Encontrados
  			</f:facet>
	        <p:column headerText="Model" style="width:24%">  
	            <h:outputText value="#{car.model}" />  
	        </p:column>  
	  
	        <p:column headerText="Year" style="width:24%">  
	            <h:outputText value="#{car.year}" />  
	        </p:column>  
	  
	        <p:column headerText="Manufacturer" style="width:24%">  
	            <h:outputText value="#{car.manufacturer}" />  
	        </p:column>  
	  
	        <p:column headerText="Color" style="width:24%">  
	            <h:outputText value="#{car.color}" />  
	        </p:column>  
	  
	        <p:column style="width:4%">  
	                <p:commandButton id="selectButton" update=":form:display" oncomplete="carDialog.show()" icon="ui-icon-search" title="View">  
	                <f:setPropertyActionListener value="#{car}" target="#{tableBean.selectedCar}" />  
	            </p:commandButton>  
	        </p:column>  
  
    </p:dataTable>  
 
	</h:form>			
 </ui:define>
</ui:composition>
</h:body>
</html>